import Mock from 'mockjs'
const Random = Mock.Random;
export default [
    {
        url: '/api/schoolMessage/list',
        method: 'get',
        response: () => {
            return {
                code: 0,
                msg: 'ok',
                data: {
                    // total: 100,

                    ...Mock.mock({
                        'users|10': [{
                            // 'id|+1': page * 10,
                            'title|1': ['关于 "@ctitle(18)" 的通知','关于 "@ctitle(25)" 的通知','关于 "@ctitle(20)" 的通知','关于 "@ctitle(20)" 的通知',
                            '关于 "@ctitle(30)" 的通知','关于 "@ctitle(32)" 的通知'],
                            'img|1': ["https://img.axureshop.com/ee/00/de/ee00de2201bf478bb4a9d4f881afd706/images/通知列表/u2447.png","https://img.axureshop.com/ee/00/de/ee00de2201bf478bb4a9d4f881afd706/images/通知列表/u2465.png","https://img.axureshop.com/ee/00/de/ee00de2201bf478bb4a9d4f881afd706/images/通知列表/u2475.png","https://img.axureshop.com/ee/00/de/ee00de2201bf478bb4a9d4f881afd706/images/通知列表/u2485.png",""],
                            editor: '@cname',
                            'time|1':['2小时前','3小时前',Random.date('yyyy-MM-dd')],
                            'statu|1':['暂停发布','发布中','编辑中']
                        }]
                    })
                }
            }
        }
    },
    //添加新文章
    {
        url: '/api/schoolNotice/add',
        method: 'post',
        response: () => {
            return {
                code: 0,
                msg: 'ok',
                data: 1
            }
        }
    },
    {
        url: '/api/schoolNotice/list',
        method: 'get',
        response: () => {
            return {
                code: 0,
                msg: 'ok',
                data: {
                    // total: 100,

                    ...Mock.mock({
                        'users|20': [{
                            // 'id|+1': page * 10,
                            'title|1': ['关于 "@ctitle(18)" 的通知','关于 "@ctitle(25)" 的通知','关于 "@ctitle(20)" 的通知','关于 "@ctitle(20)" 的通知',
                            '关于 "@ctitle(30)" 的通知','关于 "@ctitle(32)" 的通知'],
                            'img|1': [Random.image('200x100', '#50B347', '#FFF', 'Mock.js'),""],
                            editor: '@cname',
                            'time|1':['2小时前','3小时前',Random.date('yyyy-MM-dd')],
                            'statu|1':['暂停发布','发布中','编辑中']
                        }]
                    })
                }
            }
        }
    },
    //添加新通知
    {
        url: '/api/schoolMessage/add',
        method: 'post',
        response: () => {
            return {
                code: 0,
                msg: 'ok',
                data: 1
            }
        }
    },



    {
        url: '/api/items/list',
        method: 'get',
        response: () => {
          return {
            code: 0,
            msg: 'ok',
            total:29,
            ...Mock.mock({
              'data|10': [{
                'id|+1': 1,
                name:'@cname',
                phone:/^1[3-9]\d{9}$/,
                time:'@date("yyyy-MM-dd")',

              }]
            })
          }
        }
      },

      //一卡通管理

      {
        url: '/api/cart/manage',
        method: 'get',
        response: () => {
          return {
            code: 0,
            msg: 'ok',
            ...Mock.mock({
              'data|1': [{
                time:'@date("yyyy-MM-dd")',
              }]
            })
          }
        }
      },
      
      {
        url: '/api/card/list',
        method: 'get',
        response: () => {
          return {
            code: 0,
            msg: 'ok',
            ...Mock.mock({
              'data|29': [{
                id:'@natural(10000)' ,
                month:'@date("MM-dd")',
                time:'@time("HH:mm")',
                "thing|1":["1号食堂消费","东门便利店消费","公用IC电话","一体机充值"],
                'inout|1':["+","-"],
                "money|1-10000.1": 1,

              }]
            })
          }
        }
      },
]
